<?php

class application_forms_Register extends Zend_Form{
public $nom;
public $prenom;
public $date_de_naissance;
public $lieu_de_naissance;
public $quartier;
public $sexe;
public $numero_telephone;
public $ecole;
public $classe;
public $serie;
public function __construct($options = null){
        parent::__construct($options);
        // initialize form
        $this->setName('registration')
        ->setAction('Valider');
                $emptyValidator = new Zend_Validate_NotEmpty();
                $emailValidator = new Zend_Validate_EmailAddress();
                $stringLengthValdiator = new Zend_Validate_StringLength(6, 12);
                $stringLengthValdiator->setMessage(('Password must have 6 to 12 caracters'));
                //nom de l'賵diant
                $this->nom = new Zend_Form_Element_Text('nom');
                $this->nom     ->setLabel(('Nom'))
                                ->setAttrib('size', 40)
                                ->setAttrib('maxlength', 50)
                                ->setAttrib('id', 'nom')
                                ->setRequired(true)
                                ->addFilter('StripTags')
                        ->addFilter('StringTrim')
                        ->addValidator($emptyValidator)
                        ->addValidator(new Zend_Validate_Alnum());
                 // prenom
                $this->prenom = new Zend_Form_Element_Text('pr譯m');
                $this->prenom     ->setLabel(('Pr譯m'))
                                ->setAttrib('size', 40)
                                ->setAttrib('maxlength', 50)
                                ->setAttrib('id', 'pr譯m')
                                ->setRequired(true)
                                ->addFilter('StripTags')
                        ->addFilter('StringTrim')
                        ->addValidator($emptyValidator)
                        ->addValidator(new Zend_Validate_Alnum());
               //date de naissance
               $this->date_de_naissance = new Zend_Form_Element_Text('date_de_naissance');
               $this->date_de_naissance
                        ->setLabel(('Date de naissance(yyyy-mm-dd)'))
                        ->setAttrib('size', 40)
                        ->setAttrib('maxlength', 50)
                        ->setAttrib('id', 'date_de_naissance')
                        ->setRequired(true)
                        ->addFilter('StripTags')
                        ->addFilter('StringTrim')
                        ->addValidator($emptyValidator);
              // lieu de naissance
              $this->quartier= new Zend_Form_Element_Text('quartier');
              $this->quartier
                                ->setLabel(('Lieu de naissance'))
                                ->setAttrib('size', 40)
                                ->setAttrib('maxlength', 50)
                                ->setAttrib('id', 'quartier')
                                ->setRequired(true)
                                ->addFilter('StripTags')
                        ->addFilter('StringTrim')
                        ->addValidator($emptyValidator)
                        ->addValidator(new Zend_Validate_Alnum());
             // sexe
             $this->sexe = new Zend_Form_Element_Text('sexe');
             $this->sexe      ->setLabel(('Sexe'))
                                ->setAttrib('id', 'sexe')
                                ->setAttrib('maxlength', 50)
                                ->setAttrib('id', 'quartier')
                                ->setRequired(true)
                                ->addFilter('StripTags')
                                ->addFilter('StringTrim')
                                ->addValidator($emptyValidator)
                                ->addValidator(new Zend_Validate_Alnum());
            // lieu de r販sdence
            $this->lieu_de_resisdence = new Zend_Form_Element_Text('lieu_de_resisdence');
            $this->lieu_de_resisdence     ->setLabel(('Lieu de resisdence'))
                                ->setAttrib('size', 40)
                                ->setAttrib('maxlength', 50)
                                ->setAttrib('id', 'lieu de resisdence')
                                ->setRequired(true)
                                ->addFilter('StripTags')
                        ->addFilter('StringTrim')
                        ->addValidator($emptyValidator)
                        ->addValidator(new Zend_Validate_Alnum());
          // t譩phone 賵diant
          $this->numero_telephone = new Zend_Form_Element_Text('numero_telephone');
          $this->numero_telephone
                                ->setLabel(('Telephone'))
                                ->setAttrib('size', 40)
                                ->setAttrib('maxlength', 50)
                                ->setAttrib('id', 'numero_telephone ')
                                ->setRequired(true)
                                ->addFilter('StripTags')
                        ->addFilter('StringTrim')
                        ->addValidator($emptyValidator)
                        ->addValidator(new Zend_Validate_Alnum());
         // choix d'une 袯le
         $this->ecole = new Zend_Form_Element_Text('ecolelist');
         $this->ecole     ->setAttrib('size', 40)
                                ->setAttrib('maxlength', 50)
                                ->setAttrib('id', 'ecole')
                                ->setRequired(true)
                                ->addFilter('StripTags')
                                ->addFilter('StringTrim')
                                ->addValidator($emptyValidator)
                                ->addValidator(new Zend_Validate_Alnum());
         // choix d'une classe
         $this->classe = new Zend_Form_Element_Select('classelist');
         $this->classe      ->setAttrib('size', 40)
                                ->setAttrib('maxlength', 50)
                                ->setAttrib('id', 'classe')
                                ->setRequired(true)
                                ->addFilter('StripTags')
                                ->addFilter('StringTrim')
                                ->addValidator($emptyValidator)
                              ->addValidator(new Zend_Validate_Alnum());
         // choix d'une s豩e
         $this->serie = new Zend_Form_Element_Select('serielist');
         $this->serie     ->setAttrib('size', 40)
                                ->setAttrib('maxlength', 50)
                                ->setAttrib('id', 'serie')
                                ->setRequired(true)
                                ->addFilter('StripTags')
                                ->addFilter('StringTrim')
                                ->addValidator($emptyValidator)
                               ->addValidator(new Zend_Validate_Alnum());;
        $submit = new Zend_Form_Element_Submit('ok');
        $submit->setAttrib('class', 'button validate')
        ->setLabel(('Valider'));
        $captcha->setLabel('Verification:');
      $this->addElements(array($this->nom, $this->prenom, $this->date_de_naissance, $this->lieu_de_naissance, $this->sexe, $this->quartier,$this->numero_telephone,$this->image,$this->ecole,$this->classe,$this->serie,$submit));
  }
}
?>